package com.ruoyi.guarantee.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.guarantee.mapper.BAgreementMapper;
import com.ruoyi.guarantee.domain.BAgreement;
import com.ruoyi.guarantee.service.IBAgreementService;

/**
 * 履约保函Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-05
 */
@Service
public class BAgreementServiceImpl implements IBAgreementService 
{
    @Autowired
    private BAgreementMapper bAgreementMapper;

    /**
     * 查询履约保函
     * 
     * @param id 履约保函主键
     * @return 履约保函
     */
    @Override
    public BAgreement selectBAgreementById(Long id)
    {
        return bAgreementMapper.selectBAgreementById(id);
    }

    /**
     * 查询履约保函列表
     * 
     * @param bAgreement 履约保函
     * @return 履约保函
     */
    @Override
    public List<BAgreement> selectBAgreementList(BAgreement bAgreement)
    {
        return bAgreementMapper.selectBAgreementList(bAgreement);
    }

    /**
     * 新增履约保函
     * 
     * @param bAgreement 履约保函
     * @return 结果
     */
    @Override
    public int insertBAgreement(BAgreement bAgreement)
    {
        bAgreement.setCreateTime(DateUtils.getNowDate());
        return bAgreementMapper.insertBAgreement(bAgreement);
    }

    /**
     * 修改履约保函
     * 
     * @param bAgreement 履约保函
     * @return 结果
     */
    @Override
    public int updateBAgreement(BAgreement bAgreement)
    {
        bAgreement.setUpdateTime(DateUtils.getNowDate());
        return bAgreementMapper.updateBAgreement(bAgreement);
    }

    /**
     * 批量删除履约保函
     * 
     * @param ids 需要删除的履约保函主键
     * @return 结果
     */
    @Override
    public int deleteBAgreementByIds(Long[] ids)
    {
        return bAgreementMapper.deleteBAgreementByIds(ids);
    }

    /**
     * 删除履约保函信息
     * 
     * @param id 履约保函主键
     * @return 结果
     */
    @Override
    public int deleteBAgreementById(Long id)
    {
        return bAgreementMapper.deleteBAgreementById(id);
    }

    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<BAgreement> selectyyzgBAgreementList(BAgreement bAgreement) {

        return bAgreementMapper.selectyyzgBAgreementList(bAgreement);
    }

    @Override
    public List<BAgreement> selectyyzBAgreementList(BAgreement bAgreement) {
        return bAgreementMapper.selectyyzBAgreementList(bAgreement);
    }

    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<BAgreement> selectHistoryBAgreementList(BAgreement bAgreement) {
        return bAgreementMapper.selectHistoryBAgreementList(bAgreement);
    }
    @Override
    public Map<String, String> selectMapList(BAgreement bAgreement) {
        return bAgreementMapper.selectMapList(bAgreement);
    }

}
